var ul1 = document.getElementsByClassName("ct_left")[0];
var lis = ul1.getElementsByTagName("li");
var boxs = document.getElementsByClassName("c_bot");
var b = document.getElementsByTagName("b")[0];
for (var i = 0; i < lis.length; i++) {
    lis[i].onclick = function () {
        for (var i = 0; i < lis.length; i++) {
            lis[i].className = "";
            boxs[i].className = "c_bot";
        }
        this.className = "active";
        var i = parseInt(this.getAttribute("xh"));
        boxs[i].className = "c_bot active1";
        b.innerHTML = this.firstElementChild.innerHTML;
    }
}

var btns = banner.getElementsByTagName("button"), imgs = banner.getElementsByTagName("img"), blis = banner.getElementsByTagName("li");

var count = 0;
for (var i = 0; i < btns.length; i++) {
    btns[i].onclick = function () {
        if (this.innerText == ">") {
            count++;
            if (count > 3) {
                count = 0;
            }
            for (var i in blis) {
                imgs[i].className = "";
                blis[i].className = "";
            }
            imgs[count].className = "active";
            blis[count].className = "active";
        } else {
            count--;
            if (count < 0) {
                count = 3;
            }
            for (var i in blis) {
                imgs[i].className = "";
                blis[i].className = "";
            }
            imgs[count].className = "active";
            blis[count].className = "active";
        }
    }
}


for (var i = 0; i < blis.length; i++) {
    blis[i].onclick = function () {
        for (var i in blis) {
            blis[i].className = "";
            imgs[i].className = "";
        }
        this.className = "active";
        count = eval(this.getAttribute("tx"));
        imgs[count].className = "active";
    }
}
timer = setInterval(function () {
    count++;
    if (count > 3) {
        count = 0;
    }
    for (var i in blis) {
        imgs[i].className = "";
        blis[i].className = "";
    }
    imgs[count].className = "active";
    blis[count].className = "active";
}, 1500);
banner.onmouseover = function () {
    clearInterval(timer);
}
banner.onmouseout = function () {
    timer = setInterval(function () {
        count++;
        if (count > 3) {
            count = 0;
        }
        for (var i in blis) {
            imgs[i].className = "";
            blis[i].className = "";
        }
        imgs[count].className = "active";
        blis[count].className = "active";
    }, 1500);
}